//
//  NetWorkUtil.m
//  QuickRentDemo
//
//  Created by qnsoft on 17/1/11.
//  Copyright © 2017年 xiebingqing. All rights reserved.
//

#import "NetWorkUtil.h"
#import "Reachability.h"

@implementation NetWorkUtil

+(BOOL)isExsitNetWork
{
    BOOL isExistenceNetwork ;
    Reachability *reachability = [Reachability reachabilityWithHostName:@"www.apple.com"];
    if ([reachability currentReachabilityStatus] == NotReachable) {
        //没有网络
        isExistenceNetwork = NO;
    }else if ([reachability currentReachabilityStatus] == ReachableViaWWAN)
    {
        //3g / 2g 网络
        isExistenceNetwork = YES;

    }else if ([reachability currentReachabilityStatus] == ReachableViaWiFi)
    {
        //wifi
        isExistenceNetwork = YES;

    }
    return isExistenceNetwork;
}
@end
